/**
 * @see [微信官方文档](https://mp.weixin.qq.com/debug/wxadoc/dev/api/network-file.html#wxuploadfileobject)
 */
export default function upload_file(url: string, filePath: string, name: string, header?: wx.RequestHeader, formData?: any) {
	return new Promise<wx.UploadFileResponse>((resolve, reject) => {
		wx.uploadFile({
			filePath,
			formData,
			header,
			name,
			url,
			success(res) {
				resolve(res);
			},
			fail() {
				reject(false);
			}
		});
	});
}
